package com.hosever.coreTest;

/**
 * 多线程测试
 * 
 * @author Sever
 * 
 */
public class MultiThreadTest implements Runnable {

	private String name;

	public MultiThreadTest(String name) {
		this.name = name;
	}

	public void run() {
		for (int i = 0; i < 5; i++) {
			System.out.print(name + ": " + i);
		}
		System.out.println();
	}

	public static void main(String[] args) {
		MultiThreadTest mtt1 = new MultiThreadTest("阿大");
		MultiThreadTest mtt2 = new MultiThreadTest("阿二");
		MultiThreadTest mtt3 = new MultiThreadTest("阿三");
		MultiThreadTest mtt4 = new MultiThreadTest("阿四");

		Thread t1 = new Thread(mtt1);
		Thread t2 = new Thread(mtt2);
		Thread t3 = new Thread(mtt3);
		Thread t4 = new Thread(mtt4);

		t1.start();
		t2.start();
		t3.start();
		t4.start();
	}
}
